import argparse
import predict

if __name__ == '__main__':

    # 传入训练任务的信息，和需要识别的数据集
    parser = argparse.ArgumentParser(description='Run training script with given parameters.')
    parser.add_argument('trainMissionId', type=int, help='trainMissionId.')
    parser.add_argument('modelName', type=str, help='The model to use.')
    parser.add_argument('model_User_id', type=str, help='The dataset to use.')
    parser.add_argument('datasetTrain', type=str, help='The dataset to use.')
    parser.add_argument('datasetTrainName', type=str, help='The datasetTrainName to use.')
    parser.add_argument('datasetVal', type=str, help='The dataset to use.')
    parser.add_argument('DatasetNameVal', type=str, help='The dataset to use.')
    parser.add_argument('batchSize', type=int, help='The batch size.')
    parser.add_argument('epochMin', type=int, help='The number of epochs.')
    parser.add_argument('epoch', type=int, help='The number of epochs.')
    parser.add_argument('earlyStop', type=int, help='Whether to use early stopping.')
    parser.add_argument('imageSize', type=int, help='imageSize.')
    parser.add_argument('modelId', type=int, help='modelId.')
    parser.add_argument('inferenceDatasetlocation', type=str, help='inferenceDatasetlocation.')
    parser.add_argument('inferenceDatasetId', type=int, help='inferenceDatasetlocation.')
    parser.add_argument('userId', type=str, help='userId.')
    parser.add_argument('inputChan', type=int, help='inputChan.')
    parser.add_argument('outChan', type=int, help='outChan.')

    args = parser.parse_args()
    predict.Run(args.trainMissionId, args.modelName, args.model_User_id, args.datasetTrain, args.datasetTrainName, args.datasetVal,
        args.DatasetNameVal, args.batchSize,args.epochMin ,args.epoch, args.earlyStop, args.imageSize, args.modelId, args.inferenceDatasetlocation,
        args.inferenceDatasetId,
        args.userId,
        args.inputChan,
        args.outChan
        )

    # predict.Run("310",
    #     "UNet",
    #     "1",
    #     "E:/Detection20250222/src/main/resources/datasets/1/cd/",
    #     "test",
    #     "E:/Detection20250222/src/main/resources/datasets/1/cd/",
    #     "test",
    #     "4",
    #     "20",
    #     "40",
    #     "10",
    #     512,
    #     "156",
    #     "E:/Detection20250222/src/main/resources/datasets/1/cd/",
    #     "214",
    #     "1",
    #     3,
    #     2
    #     )